﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace AMebooking.Models
{
    public class Mechanic
    {
        public string smanid { get; set; }
        public string name { get; set; }
        public string dept { get; set; }
        public string phone { get; set; }
        public string email { get; set; }
        public string subsystem { get; set; }
        public string unitid { get; set; }


        public Mechanic(string id, string nameM, string deptId, string phone2,
            string email2, string subsystem2, string unitid2)
        {
            smanid = id;
            name = nameM;
            dept = deptId;
            phone = phone2;
            email = email2;
            subsystem = subsystem2;
            unitid = unitid2;
        }
        public Mechanic() { }
        public override string ToString()
        {
            string objFormat = "\"Department\": \"{0}\""
                               + " ,\"Email\":\"{1}\""
                               + " ,\"Name\":\"{2}\""
                               + " ,\"Phone\":\"{3}\""
                               + " ,\"SmanId\":\"{4}\""
                               + " ,\"Subsystem\":\"{5}\""
                               + " ,\"UnitId\":\"{6}\"";
                            
            var data = string.Format(objFormat, dept, email, name, phone, smanid, subsystem, unitid);
            return "{" + data + "}";
        }
    }
}
